<!DOCTYPE html><html lang="zh-cn"><head><link rel=manifest href=/manifest.json><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="format-detection" content="telephone=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><link rel="icon" href="/images/icons/icon.jpg?v=2.0.0-rc.0" type="image/png" sizes="16x16"><link rel="icon" href="/images/icons/icon.jpg?v=2.0.0-rc.0" type="image/png" sizes="32x32"><meta name="description" content="七亿人用，十亿人骂，拼多多为何能在骂声中拼成拼爹爹呢？靠四拼——拼“地气”、拼“心理”、拼“平台”、拼“简单”">
<meta name="keywords" content="管理,案例,市场">
<meta property="og:type" content="article">
<meta property="og:title" content="并夕夕如何拼成拼爹爹—拼多多的四拼理论">
<meta property="og:url" content="&#x2F;2020&#x2F;11&#x2F;01&#x2F;Marketing%E2%80%94%E2%80%94%E6%8B%BC%E5%A4%9A%E5%A4%9A%E5%A6%82%E4%BD%95%E5%8F%98%E6%88%90%E6%8B%BC%E7%88%B9%E7%88%B9&#x2F;">
<meta property="og:site_name" content="Olice&#39;s Blog">
<meta property="og:description" content="七亿人用，十亿人骂，拼多多为何能在骂声中拼成拼爹爹呢？靠四拼——拼“地气”、拼“心理”、拼“平台”、拼“简单”">
<meta property="og:locale" content="zh-cn">
<meta property="og:updated_time" content="2022-03-31T15:56:02.825Z">
<meta name="twitter:card" content="summary"><meta name="keywords" content="Olice, Olice's Blog"><meta name="description" content="技术,生活"><title>并夕夕如何拼成拼爹爹—拼多多的四拼理论 | Olice's Blog</title><link ref="canonical" href="/2020/11/01/Marketing%E2%80%94%E2%80%94%E6%8B%BC%E5%A4%9A%E5%A4%9A%E5%A6%82%E4%BD%95%E5%8F%98%E6%88%90%E6%8B%BC%E7%88%B9%E7%88%B9/"><link rel="alternate" href="/atom.xml" type="application/atom+xml"><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.1/css/all.min.css" type="text/css"><link rel="stylesheet" href="/css/index.css?v=2.0.0-rc.0"><script>var Stun = window.Stun || {};
var CONFIG = {
  root: '/',
  algolia: undefined,
  fontIcon: {"prompt":{"success":"fas fa-check-circle","info":"fas fa-arrow-circle-right","warning":"fas fa-exclamation-circle","error":"fas fa-times-circle"},"copyBtn":"fas fa-copy"},
  sidebar: {"offsetTop":"20px","tocMaxDepth":6},
  header: {"enable":true,"showOnPost":false,"scrollDownIcon":true},
  postWidget: {"endText":true},
  nightMode: {"enable":true},
  back2top: {"enable":true},
  codeblock: {"style":"default","highlight":"ocean","wordWrap":false},
  reward: false,
  fancybox: false,
  zoomImage: {"gapAside":"20px"},
  galleryWaterfall: undefined,
  lazyload: false,
  pjax: undefined,
  externalLink: {"icon":{"enable":true,"name":"fas fa-external-link-alt"}},
  shortcuts: {"switchPost":true},
  prompt: {"copyButton":"Copy","copySuccess":"Copy Success","copyError":"Copy Error"},
  sourcePath: {"js":"js","css":"css","images":"images"},
};

window.CONFIG = CONFIG;</script></head><body><div class="container" id="container"><header class="header" id="header"><div class="header-inner header-inner--height header-inner--bgcolor"><nav class="header-nav header-nav--sticky"><div class="header-nav-inner"><div class="header-nav-menubtn"><i class="fas fa-bars"></i></div><div class="header-nav-menu"><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/"><span class="header-nav-menu-item__icon"><i class="fas fa-home"></i></span><span class="header-nav-menu-item__text">Home</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/archives/"><span class="header-nav-menu-item__icon"><i class="fas fa-folder-open"></i></span><span class="header-nav-menu-item__text">Archives</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/categories/"><span class="header-nav-menu-item__icon"><i class="fas fa-layer-group"></i></span><span class="header-nav-menu-item__text">Categories</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="/tags/"><span class="header-nav-menu-item__icon"><i class="fas fa-tags"></i></span><span class="header-nav-menu-item__text">Tags</span></a></div><div class="header-nav-menu-item"><a class="header-nav-menu-item__link" href="javascript:;" onclick="return false;"><span class="header-nav-menu-item__icon"><i class="fa fa-address-book"></i></span><span class="header-nav-menu-item__text">友链</span></a><div class="header-nav-submenu"><div class="header-nav-submenu-item"><a class="header-nav-submenu-item__link" href="https://mikyming.online/"><span class="header-nav-submenu-item__text">BobbyRong</span></a></div></div></div></div><div class="header-nav-search"><span class="header-nav-search__icon"><i class="fas fa-search"></i></span><span class="header-nav-search__text">Search</span></div><div class="header-nav-mode"><div class="mode"><div class="mode-track"><span class="mode-track-moon"></span><span class="mode-track-sun"></span></div><div class="mode-thumb"></div></div></div></div></nav></div></header><main class="main" id="main"><div class="main-inner"><div class="content-wrap" id="content-wrap"><div class="content" id="content"><!-- Just used to judge whether it is an article page--><div id="is-post"></div><div class="post"><header class="post-header"><h1 class="post-title">并夕夕如何拼成拼爹爹—拼多多的四拼理论</h1><div class="post-meta"><span class="post-meta-item post-meta-item--createtime"><span class="post-meta-item__icon"><i class="far fa-calendar-plus"></i></span><span class="post-meta-item__info">Created</span><span class="post-meta-item__value">2020-11-01</span></span><span class="post-meta-item post-meta-item--wordcount"><span class="post-meta-item__icon"><i class="far fa-file-word"></i></span><span class="post-meta-item__info">Words</span><span class="post-meta-item__value">2.8k</span></span><span class="post-meta-item post-meta-item--visitors"><span class="post-meta-item__icon" data-popover="Visitors" data-popover-pos="up"><i class="fas fa-eye"></i></span><span class="post-meta-item__value" id="busuanzi_value_page_pv"></span></span></div></header><div class="post-body"><p>七亿人用，十亿人骂，拼多多为何能在骂声中拼成拼爹爹呢？<br>靠四拼——拼“地气”、拼“心理”、拼“平台”、拼“简单”</p>
<a id="more"></a>

<p>拼多多以赞助节目的形式强势出镜，又以“温柔一刀”“砍一砍”在各大亲戚群怒刷存在感，而后的“百元提现”让年轻人们叛变加入助力大军。<br>但拼多多却依旧无法摆脱“假货梗”、Low、消耗社交价值的标签（PPT：拼多多=Low=假货=消耗社交价值）。就是这样被无数人嘲笑的拼多多，用户规模突破七亿，营收增速赶超阿里、京东同期的营收增速2-3倍，成为中国第二大电商平台。<br>七亿人用，十亿人骂，拼多多为何能在骂声中拼成拼爹爹呢？接下来，我将阐述拼多多的四拼(Pin)理论：</p>

        <h2 id="第一拼：拼“地气”"   >
          <a href="#第一拼：拼“地气”" class="heading-link"><i class="fas fa-link"></i></a>第一拼：拼“地气”</h2>
      <p>——抢占下沉市场（五环外市场+消费群体介绍/价格敏感+C2M压价格）</p>
<p>淘宝的市场定位为网络零售商，产品以服饰、数码产品、居家产品为主。消费者定位为一二线城市的上班族或学生群体，；京东的市场定位为自营式电商企业，主打中高端市场，产品以电子产品为主，消费者定位为一二线的公司白领、公务员等群体。</p>
<p>由以上分析得出，电商的两大巨头目标市场集中在一二线城市，对三四线城市的下沉市场关注度较低，且产品服务慢慢走向高端。而对于五环外的居民以及支付能力较低的消费群体来说，他们更在意产品的质量是否好、价格是否便宜，而两大电商巨头缺少对这类消费群体的关注。<br>三四线城市与农村消费者购买力水平相对较低；低价商品是拼多多的营销核心，为了降低商品售价，拼多多从商品销售模式、平台商家和商品类型三方面入手力压商品成本，进而使低价商品成为平台的竞争力。</p>

        <h3 id="【商品销售模式】"   >
          <a href="#【商品销售模式】" class="heading-link"><i class="fas fa-link"></i></a>【商品销售模式】</h3>
      <p>C2M模式即“客户-工厂”模式，即客户下达的订单无需通过销售商，可以通过平台直接传至工厂进行生产，再由平台的供应链完成商品交付。这种直销模式简化了中间商环节，极大降低了成本。（链图）</p>

        <h3 id="【商品类型】"   >
          <a href="#【商品类型】" class="heading-link"><i class="fas fa-link"></i></a>【商品类型】</h3>
      <p>拼多多直接将销售的商品定位于价格较低的日用品、服饰等</p>

        <h3 id="【平台商家】"   >
          <a href="#【平台商家】" class="heading-link"><i class="fas fa-link"></i></a>【平台商家】</h3>
      <p>初成立的拼多多聚焦于没有大牌溢价的中小型商家，而当时，此类商家正是淘宝商家定位战略的“漏网之鱼”，因此，这些被淘宝忽略的商家极愿意接受拼多多平台抛出的橄榄枝，并主动让利以争取“薄利多销”，以致商品的价格再度下降。</p>

        <h2 id="第二拼：拼“心理”"   >
          <a href="#第二拼：拼“心理”" class="heading-link"><i class="fas fa-link"></i></a>第二拼：拼“心理”</h2>
      <p>——占便宜+限时+整合营销+互利互惠（团购社交化/游戏化）+爽（联想网红带货，会提供场景，而拼多多魔幻的价格，也给你提供了一个场景，四舍五入等于不要钱，可以闭眼买买买）</p>
<p>利用人们“占便宜”的心理，拼多多过去的战略，从心理分析来说，本质上其实并不是服务三四五线城市的人，而是满足用户内心的三四五线的需求，是满足了每一个人内心的下沉欲望，这里的下沉不是贬义词。换言之，拼多多的核心不是廉价，而是满足用户心里占廉价的感觉。拼多多满足了所有人的某一类需求，而不是某一类人的所有需求。<br>近日QuestMobile数据显示，拼多多一二线城市用户对GMV的贡献已达到48%，并呈持续上升趋势；新增用户中，二级及以上城市用户占比已接近一半，其中北京、成都、天津、上海、杭州排前五。这代表性价比这件事情不分城市，分人。每个人都有追求性价比的一面。<br>拼多多抓住了这个心理，采用限时拼团购模式，“占便宜”+“限时”，“占便宜”激发消费者的购物欲，“限时”让消费者没时间犹豫，双重因素下促进着用户不断转发，参与拼团、砍价，形成自发的传播力量；<br>年轻人的钱也不是大风刮来的！能省就省了呗！现在拼多多在年轻人心里已经由“假冒伪劣产品重灾区”变为“快乐薅羊毛必备app”</p>

        <h3 id="【互利互惠-一起薅羊毛】"   >
          <a href="#【互利互惠-一起薅羊毛】" class="heading-link"><i class="fas fa-link"></i></a>【互利互惠 一起薅羊毛】</h3>
      <p>自成立之时，拼多多就秉承营销理念“用户通过发起和朋友、家人、邻居等的拼团，以更低的价格拼团购买商品。旨在凝聚更多人的力量，用更低的价格买到更好的东西，体会更多的实惠和乐趣”。</p>

        <h3 id="【树立大平台和值得信赖的形象】"   >
          <a href="#【树立大平台和值得信赖的形象】" class="heading-link"><i class="fas fa-link"></i></a>【树立大平台和值得信赖的形象】</h3>
      <p>大量投放广告（图）、娱乐营销占领用户心智（图），利用公益营销提升口碑（图）（拼多多一直以来开展“一起助农货”，扶贫助农的项目，成绩显著。使得拼多多在三四五线城市目标人群中积累了一定的口碑，树立良好社会形象。2017年，在“中国时间”年度经济新闻盘点邀请主力暨颁奖典礼上，拼多多凭借助农精准脱贫上的成绩荣获“脱贫优秀奖”；） </p>

        <h2 id="第三拼：拼“平台”"   >
          <a href="#第三拼：拼“平台”" class="heading-link"><i class="fas fa-link"></i></a>第三拼：拼“平台”</h2>
      <p>——  将移动电商与社交媒体进行深度融合</p>
<p>拼多多独创社交电商模式，打破以往传统电商搜索式的被动状态，通过社交手段主动刺激用户需求。是移动电商与社交媒体相结合的社交电商模式，相较于传统电商先有需求再进行不同，社交电商是基于微信聊天、朋友圈等功能，通过社交的方式主动刺激需求，增加了用户非目的性购物的机会。比如你想要用一块钱买到某个六人拼团的商品，就必须找到你身边五个人一起购买，如果一起拼团的成功率为 50%，你就得找 12 个人帮你成团，这种裂变式的病毒传播，从而带来平台用户活跃和新用户的持续增长，而且是以极低的传播成本。 拼多多以拼团模式紧紧抓住移动社交的流量红利，背靠微信这拥有 10 亿用户的流量大入口，从而迅速崛起。<br>目前微信的月活跃用户超过 11亿，拼多多持续不断的引流是通过微信庞大且强粘性的用户基础，通过微信这个入口，拼多多得以触达互联网主流用户，同时借助微信支付、小程序等简化购物流程，形成闭环。目前拼多多小程序的月活超过两亿。同时，腾讯也借助拼多多，实现了自身社交流量的变现。</p>

        <h2 id="第四拼：拼“简单”"   >
          <a href="#第四拼：拼“简单”" class="heading-link"><i class="fas fa-link"></i></a>第四拼：拼“简单”</h2>
      <p>——拼多多教会我妈网购了、四步下单、一键转发、降低用户成本【拼多多页面的精简设计】</p>
<p>突然有一天，您的母上大人给你发来砍一砍消息（图），想不到吧，拼多多竟然教会了我妈网购，原来教一周都还不会。现如今各大电商平台的游戏规则也是越来越烧脑，别说爸妈了，凑满减我们都凑得头疼。<br>但拼多多的页面设计十分精简，首页即是商品浏览界面，低价格、高销量抓人眼球，特色服务一目了然，没有购物车功能，单件产品直接购买或发起拼团，不需要凑单即可享受包邮。从确认商品到购买成功只有四个环节，简化了传统电商平台复杂的购物模式，大大降低了中老年等群体的用户成本，使用减少了消费者犹豫和凑单的时间，促进其消费意愿。</p>

        <h2 id="STP策略评价✔"   >
          <a href="#STP策略评价✔" class="heading-link"><i class="fas fa-link"></i></a>STP策略评价✔</h2>
      
        <h3 id="优势："   >
          <a href="#优势：" class="heading-link"><i class="fas fa-link"></i></a>优势：</h3>
      <p><strong>目标市场关注被其他电商忽略的消费群体，增强竞争力</strong><br>（在三四线小城市中，消费者的价格敏感度高，仍然有很多消费者完全未接触或参与过网购，这个被忽视的市场存在着很大的潜力。所以拼多多的这个选择使其在行业中独具特色，别人无法取代，并不断发展壮大。）<br><strong>目标用户选择明确，市场定位精准</strong><br>（通过对各种指标的分析，拼多多对自己所面对的客户形成了一个综合的认知，按照这个认知推出合适的产品。精准的定位推动了拼多多差异化营销模式的发展，使其更好发挥营销效果，同时也有利于企业集中人力、物力投入目标市场，提高经济效益）</p>

        <h3 id="劣势："   >
          <a href="#劣势：" class="heading-link"><i class="fas fa-link"></i></a>劣势：</h3>
      
        <h4 id="不恰当的营销方式可能造成信任危机，不利于巩固目标客户群体"   >
          <a href="#不恰当的营销方式可能造成信任危机，不利于巩固目标客户群体" class="heading-link"><i class="fas fa-link"></i></a>不恰当的营销方式可能造成信任危机，不利于巩固目标客户群体</h4>
      <p>拼多多经常会开展“0.01元抢”“砍价免费拿”等活动。但是中奖率极低，即使在活动前用户就被告知中奖率极低，在多次参加活动没有中奖后也会对平台产生失望的情绪。动中也存在先提价再砍价的现象，商品在“砍价免费拿”活动前价格会被修改为原价的数倍。并且砍价过程中，砍价的效率是递减的。严重地影响了用户对平台的信任，不利于品牌形象的树立。</p>

        <h4 id="低价营销策略可能存在商品质量问题，也会对未来开拓新市场造成影响"   >
          <a href="#低价营销策略可能存在商品质量问题，也会对未来开拓新市场造成影响" class="heading-link"><i class="fas fa-link"></i></a>低价营销策略可能存在商品质量问题，也会对未来开拓新市场造成影响</h4>
      <p>商家为了配合拼多多的低价策略，不得不降低成本，造成了商品质量下降。另一方面拼多多对于商家的要求不高，有一部分不良商家看准了这个时机，进入拼多多平台向消费者销售假冒伪劣商品。低价营销策略和质量管控薄弱造成的严重商品质量问题，大大影响了消费者的购物体验。另外长期坚持低价营销策略也会使拼多多的用户市场得不到开拓，一直停留在当前层面，可能会造成拼多多后期乏力，得不到更好的发展。</p>

        <h2 id="面临问题及相应解决方案"   >
          <a href="#面临问题及相应解决方案" class="heading-link"><i class="fas fa-link"></i></a>面临问题及相应解决方案</h2>
      <p>（一）加强平台监管力度<br>（二）完善售前售后服务体系<br>（三）加强直播带货，增加购物趣味</p>
</div><footer class="post-footer"><div class="post-ending ending"><div class="ending__text">------ END ------</div></div><div class="post-copyright copyright"><div class="copyright-author"><span class="copyright-author__name">Author: </span><span class="copyright-author__value"></span></div><div class="copyright-link"><span class="copyright-link__name">Link: </span><span class="copyright-link__value"></span></div><div class="copyright-notice"><span class="copyright-notice__name">Copyright: </span><span class="copyright-notice__value">All articles in this blog are licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-cn" rel="external nofollow" target="_blank">BY-NC-SA</a> unless stating additionally</span></div></div><div class="post-tags"><span class="post-tags-item"><span class="post-tags-item__icon"><i class="fas fa-tag"></i></span><a class="post-tags-item__link" href="/tags/%E7%AE%A1%E7%90%86/">管理</a></span><span class="post-tags-item"><span class="post-tags-item__icon"><i class="fas fa-tag"></i></span><a class="post-tags-item__link" href="/tags/%E6%A1%88%E4%BE%8B/">案例</a></span><span class="post-tags-item"><span class="post-tags-item__icon"><i class="fas fa-tag"></i></span><a class="post-tags-item__link" href="/tags/%E5%B8%82%E5%9C%BA/">市场</a></span></div><nav class="post-paginator paginator"><div class="paginator-prev"><a class="paginator-prev__link" href="/2020/11/23/Marketing%E2%80%94%E2%80%94%E8%8A%82%E6%97%A5%E8%90%A5%E9%94%80%E4%B8%AD%E7%9A%84%E6%83%85%E6%84%9F%E8%A1%A8%E8%BE%BE/"><span class="paginator-prev__icon"><i class="fas fa-angle-left"></i></span><span class="paginator-prev__text">节日营销中的情感表达</span></a></div><div class="paginator-next"><a class="paginator-next__link" href="/2020/10/10/Marketing%E2%80%94%E2%80%94%E5%88%9B%E5%A7%8B%E4%BA%BA%E5%AF%B9%E5%93%81%E7%89%8C%E6%96%87%E5%8C%96%E7%9A%84%E5%BD%B1%E5%93%8D/"><span class="paginator-prev__text">创始人对企业品牌文化营销的影响</span><span class="paginator-next__icon"><i class="fas fa-angle-right"></i></span></a></div></nav></footer></div></div></div><div class="sidebar-wrap" id="sidebar-wrap"><aside class="sidebar" id="sidebar"><div class="sidebar-nav"><span class="sidebar-nav-toc current">Catalog</span><span class="sidebar-nav-ov">Overview</span></div><section class="sidebar-toc"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#第一拼：拼“地气”"><span class="toc-number">1.</span> <span class="toc-text">
          第一拼：拼“地气”</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#【商品销售模式】"><span class="toc-number">1.1.</span> <span class="toc-text">
          【商品销售模式】</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#【商品类型】"><span class="toc-number">1.2.</span> <span class="toc-text">
          【商品类型】</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#【平台商家】"><span class="toc-number">1.3.</span> <span class="toc-text">
          【平台商家】</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第二拼：拼“心理”"><span class="toc-number">2.</span> <span class="toc-text">
          第二拼：拼“心理”</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#【互利互惠-一起薅羊毛】"><span class="toc-number">2.1.</span> <span class="toc-text">
          【互利互惠 一起薅羊毛】</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#【树立大平台和值得信赖的形象】"><span class="toc-number">2.2.</span> <span class="toc-text">
          【树立大平台和值得信赖的形象】</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第三拼：拼“平台”"><span class="toc-number">3.</span> <span class="toc-text">
          第三拼：拼“平台”</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#第四拼：拼“简单”"><span class="toc-number">4.</span> <span class="toc-text">
          第四拼：拼“简单”</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#STP策略评价✔"><span class="toc-number">5.</span> <span class="toc-text">
          STP策略评价✔</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#优势："><span class="toc-number">5.1.</span> <span class="toc-text">
          优势：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#劣势："><span class="toc-number">5.2.</span> <span class="toc-text">
          劣势：</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#不恰当的营销方式可能造成信任危机，不利于巩固目标客户群体"><span class="toc-number">5.2.1.</span> <span class="toc-text">
          不恰当的营销方式可能造成信任危机，不利于巩固目标客户群体</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#低价营销策略可能存在商品质量问题，也会对未来开拓新市场造成影响"><span class="toc-number">5.2.2.</span> <span class="toc-text">
          低价营销策略可能存在商品质量问题，也会对未来开拓新市场造成影响</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#面临问题及相应解决方案"><span class="toc-number">6.</span> <span class="toc-text">
          面临问题及相应解决方案</span></a></li></ol></section><!-- ov = overview--><section class="sidebar-ov hide"><div class="sidebar-ov-author"><div class="sidebar-ov-author__avatar"><img class="sidebar-ov-author__avatar_img" src="/images/icons/olice.jpg" alt="avatar"></div><p class="sidebar-ov-author__text">love life</p></div><div class="sidebar-ov-social"><a class="sidebar-ov-social-item" href="mailto:398700412@qq.com" target="_blank" rel="noopener" data-popover="social.email" data-popover-pos="up"><span class="sidebar-ov-social-item__icon"><i class="fas fa-envelope"></i></span></a></div><div class="sidebar-ov-feed"><span class="sidebar-ov-feed-rss"><a class="sidebar-ov-feed-rss__link" href="/atom.xml" target="_blank" rel="noopener"><span class="sidebar-ov-feed-rss__icon"><i class="fas fa-rss"></i></span><span>RSS Subscribe</span></a></span></div><div class="sidebar-ov-state"><a class="sidebar-ov-state-item sidebar-ov-state-item--posts" href="/archives/"><div class="sidebar-ov-state-item__count">20</div><div class="sidebar-ov-state-item__name">Archives</div></a><a class="sidebar-ov-state-item sidebar-ov-state-item--categories" href="/categories/"><div class="sidebar-ov-state-item__count">5</div><div class="sidebar-ov-state-item__name">Categories</div></a><a class="sidebar-ov-state-item sidebar-ov-state-item--tags" href="/tags/"><div class="sidebar-ov-state-item__count">22</div><div class="sidebar-ov-state-item__name">Tags</div></a></div><div class="sidebar-ov-cc"><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-cn" target="_blank" rel="noopener" data-popover="Creative Commons" data-popover-pos="up"><img src="/images/cc-by-nc-sa.svg"></a></div></section><div class="sidebar-reading"><div class="sidebar-reading-info"><span class="sidebar-reading-info__text">You have read </span><span class="sidebar-reading-info__num">0</span></div><div class="sidebar-reading-line"></div></div></aside></div><div class="clearfix"></div></div></main><footer class="footer" id="footer"><div class="footer-inner"><div><span>Copyright © 2022</span><span class="footer__icon"><i class="fas fa-heart"></i></span><span>Olice</span></div><div><span>Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a></span><span> v4.0.0</span><span class="footer__devider">|</span><span>Theme - <a href="https://github.com/liuyib/hexo-theme-stun/" title="Stun" target="_blank" rel="noopener">Stun</a></span><span> v2.0.0-rc.0</span></div><div class="busuanzi"><span class="busuanzi-siteuv"><span class="busuanzi-siteuv__icon" data-popover-pos="up" data-popover="Unique Visitor"><i class="fas fa-user"></i></span><span class="busuanzi-siteuv__value" id="busuanzi_value_site_uv"></span></span><span class="busuanzi-sitepv"><span class="busuanzi-siteuv__icon" data-popover-pos="up" data-popover="Page View"><i class="fas fa-eye"></i></span><span class="busuanzi-siteuv__value" id="busuanzi_value_site_pv"></span></span></div></div></footer><div class="loading-bar" id="loading-bar"><div class="loading-bar__progress"></div></div><div class="back2top" id="back2top"><span class="back2top__icon"><i class="fas fa-rocket"></i></span></div></div><div class="search-mask"></div><div class="search-popup"><span class="search-close"></span><div class="search-input"><input placeholder="Search for Posts (Support multiple keywords)"></div><div class="search-results"></div></div><script src="https://cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js"></script><script src="https://cdn.jsdelivr.net/npm/ribbon.js@latest/dist/ribbon.min.js" size="120" alpha="0.6" zIndex="-1"></script><script>function initSearch() {
  var isXML = true;
  var search_path = 'search.json';

  if (!search_path) {
    search_path = 'search.xml';
  } else if (/json$/i.test(search_path)) {
    isXML = false;
  }

  var path = '/' + search_path;
  $.ajax({
    url: path,
    dataType: isXML ? 'xml' : 'json',
    async: true,
    success: function (res) {
      var datas = isXML ? $('entry', res).map(function () {
        // 将 XML 转为 JSON
        return {
          title: $('title', this).text(),
          content: $('content', this).text(),
          url: $('url', this).text()
        };
      }).get() : res;
      var $input = $('.search-input input');
      var $result = $('.search-results');
      // 搜索对象（标题、内容）的权重，影响显示顺序
      var WEIGHT = { title: 100, content: 1 };
      var searchPost = function () {
        var searchText = $input.val().toLowerCase().trim();
        // 根据空白字符分隔关键字
        var keywords = searchText.split(/[\s]+/);
        // 搜索结果
        var matchPosts = [];

        // 有多个关键字时，将原文字整个保存下来
        if (keywords.length > 1) {
          keywords.push(searchText);
        }
        // 防止未输入字符时搜索
        if (searchText.length > 0) {
          datas.forEach(function (data) {
            var isMatch  = false;
            // 没有标题的文章使用预设的 i18n 变量代替
            var title = (data.title && data.title.trim()) || '[ Untitled ]';
            var titleLower = title && title.toLowerCase();
            // 删除 HTML 标签 和 所有空白字符
            var content = data.content && data.content.replace(/<[^>]+>/g, '');
            var contentLower = content && content.toLowerCase();
            // 删除重复的 /
            var postURL = data.url && decodeURI(data.url).replace(/\/{2,}/g, '/');
            // 标题中匹配到的关键词
            var titleHitSlice = [];
            // 内容中匹配到的关键词
            var contentHitSlice = [];

            keywords.forEach(function (keyword) {
              /**
              * 获取匹配的关键词的索引
              * @param {String} keyword 要匹配的关键字
              * @param {String} text 原文字
              * @param {Boolean} caseSensitive 是否区分大小写
              * @param {Number} weight 匹配对象的权重。权重大的优先显示
              * @return {Array}
              */
              function getIndexByword (word, text, caseSensitive, weight) {
                if (!word || !text) {
                  return [];
                };

                var startIndex = 0; // 每次匹配的开始索引
                var index = -1;     // 匹配到的索引值
                var result = [];    // 匹配结果

                if (!caseSensitive) {
                  word = word.toLowerCase();
                  text = text.toLowerCase();
                }

                while((index = text.indexOf(word, startIndex)) !== -1) {
                  var hasMatch = false;
                  // 索引位置相同的关键词，保留长度较长的
                  titleHitSlice.forEach(function (hit) {
                    if (hit.index === index && hit.word.length < word.length) {
                      hit.word = word;
                      hasMatch = true;
                    }
                  });
                  startIndex = index + word.length;
                  !hasMatch && result.push({ index: index, word: word, weight: weight });
                }
                return result;
              }
              titleHitSlice = titleHitSlice.concat(getIndexByword(keyword, titleLower, false, WEIGHT.title));
              contentHitSlice = contentHitSlice.concat(getIndexByword(keyword, contentLower, false, WEIGHT.content));
            });

            var hitTitle = titleHitSlice.length;
            var hitContent = contentHitSlice.length;

            if (hitTitle > 0 || hitContent > 0) {
              isMatch = true;
            }
            if (isMatch) {
              ;[titleHitSlice, contentHitSlice].forEach(function (hit) {
                // 按照匹配文字的索引的递增顺序排序
                hit.sort(function (left, right) {
                  return left.index - right.index;
                });
              });
              /**
              * 给文本中匹配到的关键词添加标记，从而进行高亮显示
              * @param {String} text 原文本
              * @param {Array} hitSlice 匹配项的索引信息
              * @param {Number} start 开始索引
              * @param {Number} end 结束索引
              * @return {String}
              */
              function highlightKeyword (text, hitSlice, start, end) {
                if (!text || !hitSlice || !hitSlice.length) {
                  return;
                }

                var result = '';
                var startIndex = start;
                var endIndex = end;
                hitSlice.forEach(function (hit) {
                  if (hit.index < startIndex) {
                    return;
                  }

                  var hitWordEnd = hit.index + hit.word.length;
                  result += text.slice(startIndex, hit.index);
                  result += '<b>' + text.slice(hit.index, hitWordEnd) + '</b>';
                  startIndex = hitWordEnd;
                });
                result += text.slice(startIndex, endIndex);
                return result;
              }

              var postData = {};
              // 文章总的搜索权重
              var postWeight = titleHitSlice.length * WEIGHT.title + contentHitSlice.length * WEIGHT.content;
              // 标记匹配关键词后的标题
              var postTitle = highlightKeyword(title, titleHitSlice, 0, title.length) || title;
              // 标记匹配关键词后的内容
              var postContent;
              // 显示内容的长度
              var SHOW_WORD_LENGTH = 200;
              // 命中关键词前的字符显示长度
              var SHOW_WORD_FRONT_LENGTH = 20;
              var SHOW_WORD_END_LENGTH = SHOW_WORD_LENGTH - SHOW_WORD_FRONT_LENGTH;

              // 截取匹配的第一个字符，前后共 200 个字符来显示
              if (contentHitSlice.length > 0) {
                var firstIndex = contentHitSlice[0].index;
                var start = firstIndex > SHOW_WORD_FRONT_LENGTH ? firstIndex - SHOW_WORD_FRONT_LENGTH : 0;
                var end = firstIndex + SHOW_WORD_END_LENGTH;
                postContent = highlightKeyword(content, contentHitSlice, start, end);
              } else { // 未匹配到内容，直接截取前 200 个字符来显示
                postContent = content.slice(0, SHOW_WORD_LENGTH);
              }
              postData.title = postTitle;
              postData.content = postContent;
              postData.url = postURL;
              postData.weight = postWeight;
              matchPosts.push(postData);
            }
          });
        }

        var resultInnerHtml = '';
        if (matchPosts.length) {
          // 按权重递增的顺序排序，使权重大的优先显示
          matchPosts.sort(function (left, right) {
            return right.weight - left.weight;
          });
          resultInnerHtml += '<ul>';
          matchPosts.forEach(function (post) {
            resultInnerHtml += '<li><a class="search-results-title" href="' + post.url + '">';
            resultInnerHtml += post.title;
            resultInnerHtml += '</a><div class="search-results-content">';
            resultInnerHtml += post.content;
            resultInnerHtml += '</div></li>';
          });
          resultInnerHtml += '</ul>';
        } else {
          resultInnerHtml += '<div class="search-results-none"><i class="far fa-meh"></i></div>';
        }
        $result.html(resultInnerHtml);
      };
      $input.on('input', searchPost);
      $input.on('keyup', function (e) {
        if (e.keyCode === Stun.utils.codeToKeyCode('Enter')) {
          searchPost();
        }
      });
    }
  });
}

function closeSearch () {
  $('body').css({ overflow: 'auto' });
  $('.search-popup').css({ display: 'none' });
  $('.search-mask').css({ display: 'none' });
}

window.addEventListener('DOMContentLoaded', function () {
  Stun.utils.pjaxReloadLocalSearch = function () {
    $('.header-nav-search').on('click', function (e) {
      e.stopPropagation();
      $('body').css('overflow', 'hidden');
      $('.search-popup')
        .velocity('stop')
        .velocity('transition.expandIn', {
          duration: 300,
          complete: function () {
            $('.search-popup input').focus();
          }
        });
      $('.search-mask')
        .velocity('stop')
        .velocity('transition.fadeIn', {
          duration: 300
        });

      initSearch();
    });
    $('.search-mask, .search-close').on('click', function () {
      closeSearch();
    });
    $(document).on('keydown', function (e) {
      // Escape <=> 27
      if (e.keyCode === Stun.utils.codeToKeyCode('Escape')) {
        closeSearch();
      }
    });
  };

  Stun.utils.pjaxReloadLocalSearch();
}, false);</script><script src="https://cdn.jsdelivr.net/gh/sukkaw/busuanzi@latest/bsz.pure.mini.js" async></script><script src="/js/utils.js?v=2.0.0-rc.0"></script><script src="/js/stun-boot.js?v=2.0.0-rc.0"></script><script src="/js/scroll.js?v=2.0.0-rc.0"></script><script src="/js/header.js?v=2.0.0-rc.0"></script><script src="/js/sidebar.js?v=2.0.0-rc.0"></script><script>if ('serviceWorker' in navigator) {
  navigator.serviceWorker.register('/sw.js?t=1648792074904')
    .then(function () {console.log('ServiceWorker Register Successfully.')})
    .catch(function (e) {console.error(e)});
}
</script></body></html>